import boto3


def send_msg(msg_detail):
    """
    Send a event to EventBridge
    :param msg_detail:  pass from the SQS
    :return:
    """
    print('start to send message to Event Bridge')
    entries = [
        {
            # "DetailType": "Spider State-change Notification",
            # "Source": "pt.spider",
            # "Detail": msg_detail
            msg_detail
        }
    ]
    print('putting success event to EventBus, event detail is {}...'.format(entries))
    event_bridge_client = boto3.client('events')
    response = event_bridge_client.put_events(
        Entries=entries
    )
    print('end to send message to Event Bridge')
